﻿using CISLib.EncryptClasses;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using System;

namespace CIS.Test
{
    
    
    /// <summary>
    ///This is a test class for DESEncryptTest and is intended
    ///to contain all DESEncryptTest Unit Tests
    ///</summary>
    [TestClass()]
    public class DESEncryptTest
    {


        private TestContext testContextInstance;

        /// <summary>
        ///Gets or sets the test context which provides
        ///information about and functionality for the current test run.
        ///</summary>
        public TestContext TestContext
        {
            get
            {
                return testContextInstance;
            }
            set
            {
                testContextInstance = value;
            }
        }

        #region Additional test attributes
        // 
        //You can use the following additional attributes as you write your tests:
        //
        //Use ClassInitialize to run code before running the first test in the class
        //[ClassInitialize()]
        //public static void MyClassInitialize(TestContext testContext)
        //{
        //}
        //
        //Use ClassCleanup to run code after all tests in a class have run
        //[ClassCleanup()]
        //public static void MyClassCleanup()
        //{
        //}
        //
        //Use TestInitialize to run code before running each test
        //[TestInitialize()]
        //public void MyTestInitialize()
        //{
        //}
        //
        //Use TestCleanup to run code after each test has run
        //[TestCleanup()]
        //public void MyTestCleanup()
        //{
        //}
        //
        #endregion


        /// <summary>
        ///A test for Decrypt
        ///</summary>
        [TestMethod()]
        public void DecryptTest()
        {
            //mydes.Decrypt(ConfigurationSettings.AppSettings["ConnectString"], "ASB12345")
            DESEncrypt target = new DESEncrypt();
            string pToDecrypt = "6280F7C1CAD6E98F08889F34C083A9AAD0EF242A2F6DC79F257832CACAC9EE8F3CCAE1C95BA2AAE2367BDE7DF010B6F1E15548330299E8446DC1DE2CC3496A39355E45DD3222EFD1947FB3987ACF34C7A997547EAD7F225A6755D5EB3992CE30C90774842D2EC3717E3CB5661BF7E6E5BC57E955CD2965ED"; // TODO: Initialize to an appropriate value
            string sKey = "ASB12345";
            string expected = "Server=(local);Database=CIS;UID=IS_CIS;Pwd=chenss*123;min pool size=1;max pool size=10000;Trusted_Connection=False";
            string actual;
            actual = target.Decrypt(pToDecrypt, sKey);
            Assert.AreEqual(expected, actual);
            Assert.Inconclusive("Verify the correctness of this test method.");
        }
    }
}
